/*
* 曲线数据
*
*
*
* */

package com.android.qjpmc.data_module;

public class CurveRecord {


    int m_ID;
    String m_BeginTime;
    String m_EndTime;
    String m_CurveName;//曲线数据名称
    CurveRecord m_NextNode = null;
    CurveRecord m_PreNode = null;


    int m_PointNum = 0;//曲线数据数量
    float[] m_DataBuff = null;//曲线数据
    DataLocation m_DataLocation = new DataLocation();

    public CurveRecord GetNext()
    {
        return m_NextNode;
    }
    public CurveRecord GetPre()
    {
        return m_PreNode;
    }
    public void SetNext(CurveRecord Node)
    {
        m_NextNode = Node;
    }
    public void SetPre(CurveRecord Node)
    {
        m_PreNode = Node;
    }
    public int AppendANode(CurveRecord Node)
    {
        CurveRecord NextNode = GetNext();
        if (Node == null)
        {
            return 1;
        }
        Node.SetNext(NextNode);
        if (NextNode != null)
        {
            NextNode.SetPre(Node);
        }
        return 0;
    }
    //创建曲线数据节点
    public int Create(int ID, String Name, String BeginTime, String EndTime, float[] data,  int DataNum, int StationID, int DeviceID, int DataTeam, int DataIndex)
    {
        if (DataNum <= 0 )
        {
            return 1;
        }
        m_ID = ID;
        m_CurveName = Name;
        m_BeginTime = BeginTime;
        m_EndTime = EndTime;
        m_DataBuff = null;
        m_DataBuff = new float[DataNum];
        m_DataBuff = data.clone();
        m_PointNum = DataNum;
        return 0;
    }

}
